﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace HdipCricketClub.Models
{
    [MetadataType(typeof(ClubMetaData))]
    public partial class Club
    {
        public string ShortName
        {
            get
            {
                return "Halverstown";
            }
        }
    
    }

    public class ClubMetaData
    {
        [Required (ErrorMessage = "Name is required.")]
        [StringLength(50, ErrorMessage = "Maximum name length is 50 characters")]
        [Display(Name = "Name:")]
        public object name;

        [Required(ErrorMessage = "Street address is required.")]
        [StringLength(30, ErrorMessage = "Maximum address length 30 characters")]
        [Display(Name = "Street 1:")]
        public object address_1;

        [Display(Name = "Street 2:")]
        [StringLength(30, ErrorMessage = "Maximum address length 30 characters")]
        public object address_2;

        [Required(ErrorMessage = "A town or city is required.")]
        [StringLength(30, ErrorMessage = "Maximum town or city length 30 characters")]
        [Display(Name = "Town / City:")]
        public object town_city;

        [Required(ErrorMessage = "A county is required.")]
        [Display(Name = "County:")]
        public object county;

        [Required(ErrorMessage = "A phone number required.")]
        [DataType(DataType.PhoneNumber)]
        [Display(Name = "Phone Number:")]
        public object phone;

        [Required(ErrorMessage = "An E Mail address is required.")]
        [Display(Name = "E Mail Address:")]
        [DataType(DataType.EmailAddress, ErrorMessage = "Incorrect E Mail address.")]
        public object email;
    }

}